home *** CD-ROM | disk | FTP | other *** search
- >>>>> Steve Clamage <clamage@Eng.Sun.COM> writes:
-
- > In article rp3@mozart.wg.icl.co.uk, Adel El-Beik <A.El-Beik@man0506.wins.icl.co.uk> writes:
- >> I have a question concerning MSVC++ v.4.00 and the April DWP C++.
- >>
- >> The following code fails on MSVC++. It doesn't like line labelled 1.
- >> It complains with
- >>
- >> C:\array\array.cpp(16) : error C2664: 'func' : cannot convert parameter 1
- >> from 'long [2][2]' to 'const long [][2]' (new behavior; please see help)
-
- > You have run into effectively the same rule that prohibits implicit
- > conversion from "T**" to "const T**". That prohibition is not new,
- > but is in the ISO/ANSI C standard, and has not been changed, since
- > it would open a hole in the type system.
-
- But converting long (*)[2] to const long (*)[2] is more like converting
- long ** to const long *const * than it is like converting long ** to const
- long **, because there is no way to modify the array -- there is, in fact,
- no array entity in memory, only two longs. A long (*)[2] points to two
- longs, whereas a const long (*)[2] points to two const longs. I don't see
- a constness hole there.
-
- I suspect this is an oversight.
-
- Jason
-
-
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-